.TH std::get_pointer_safety 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::get_pointer_safety \- std::get_pointer_safety

.SH Synopsis
   Defined in header <memory>
   std::pointer_safety get_pointer_safety() noexcept;  \fI(since C++11)\fP
                                                       (removed in C++23)

   Obtains the implementation-defined pointer safety model, which is a value of type
   std::pointer_safety.

.SH Parameters

   \fI(none)\fP

.SH Return value

   The pointer safety used by this implementation.

.SH Example


// Run this code

 #include <iostream>
 #include <memory>

 int main()
 {
     std::cout << "Pointer safety: ";
     switch (std::get_pointer_safety())
     {
         case std::pointer_safety::strict:
             std::cout << "strict\\n";
             break;
         case std::pointer_safety::preferred:
             std::cout << "preferred\\n";
             break;
         case std::pointer_safety::relaxed:
             std::cout << "relaxed\\n";
             break;
     }
 }

.SH Possible output:

 Pointer safety: relaxed

.SH See also

   pointer_safety     lists pointer safety models
   \fI(C++11)\fP            \fI(enum)\fP
   (removed in C++23)
